#include "Statement.h"
#include "LabeledStmt.h"
#include "CompoundStmt.h"
#include "ExpressionStmt.h"
#include "SelectionStmt.h"
#include "IterationStmt.h"
#include "JumpStmt.h"


Statement::~Statement(void)
{
	switch(m_iType)
	{
	case labled_stmt:
		delete m_pLabeledStmt;
		break;
	case compound_stmt:
		delete m_pCompoundStmt;
		break;
	case expression_stmt:
		delete m_pExprStmt;
		break;
	case selection_stmt:
		delete m_pSelectionStmt;
		break;
	case iteration_stmt:
		delete m_pIterationStmt;
		break;
	case jump_stmt:
		delete m_pJumpStmt;
		break;
	default:
		assert(0);
	}
}

void Statement::codeGen()
{
	COUT
	switch(m_iType)
	{
		case labled_stmt:
			m_pLabeledStmt->codeGen();
			break;
		case compound_stmt:
			m_pCompoundStmt->codeGen();
			break;
		case expression_stmt:
			m_pExprStmt->codeGen();
			break;
		case selection_stmt:
			m_pSelectionStmt->codeGen();
			break;
		case iteration_stmt:
			m_pIterationStmt->codeGen();
			break;
		case jump_stmt:
			m_pJumpStmt->codeGen();
			break;
		default:
			assert(0);
	}
}